package com.bw.mapper;

import com.bw.domain.Car;
import com.bw.domain.MonthlyCard;
import com.bw.domain.PlateType;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.List;

public interface CarMapper {
    List<Car> list(Car car);

    @Select("select * from plate_type")
    List<PlateType> listPlateType();

    void add(Car car);

    void addMonthlyCard(MonthlyCard monthlyCard);

    @Select("select count(*) from car where plate_number=#{plateNumber}")
    int checkPlateNumber(String plateNumber);


    @Select("select * from monthly_card where card_number=#{cardNumber}")
    MonthlyCard getMontyCard(String cardNumber);

    void updateMonthlyCard(MonthlyCard monthlyCard);

    @Delete("delete from car where id in (${ids})")
    int batchDel(@Param("ids") String ids);

    List<MonthlyCard> listCar();

    void updateStatus(MonthlyCard monthlyCard);
}
